﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using TIMETABLEASY.EasyCalendar.Model;
using TIMETABLEASY.EasyCalendar.Controler;

namespace TIMETABLEASY
{
    /// <summary>
    /// Logique d'interaction pour Window1.xaml
    /// </summary>
    public partial class Window1 : Window
    {
        private Events events = new Events();


        public Window1()
        {
            InitializeComponent();
            DataContext = events;
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            EventCal ev = new EventCal();
            ev.Subject = "AJOUT #007";

            ev.StartTime = Convert.ToDateTime(datePicker1.Text + " " + event_startingdate_combobox.Text);
            ev.EndTime = Convert.ToDateTime(datePicker1.Text + " " + event_endingdate_combobox.Text);

            events.Add(ev);

           
            //CalendarDay day = this.GetTemplateChild(ev.StartTime.DayOfWeek()) as CalendarDay;
            //day.ItemsSource = Events.ByDate(CurrentDate);
        }

        
    }
}
